<?php

include('km_smtp_class.php');

/* $mail = new KM_Mailer(server, port, username, password, secure); */
/* secure can be: null, tls or ssl */
$mail = new KM_Mailer("smtp.gmail.com", "587", "incrdbleroot@gmail.com", "tTypS13D", "tls");

if($mail->isLogin) {
  /* for localhost server no login is required: */
  /* $mail = new KM_Mailer('localhost', '25'); */

  /* $mail->send(from, to, subject, body, headers = optional) */
  $mail->send('incrdbleroot@gmail.com', 'tvmcarvalho@gmail.com', 'test email 1', 'This is a <b>multipart email</b>!');


/*  if(!$mail->send('username@mydomain.com', 'recipent@somedomain.com', 'test email 4', 'This is a plain text email.')) {
    echo "Failed to send email";
  } else {
    echo "Email sent successfully";
  }

  /* clear recipients and attachments */
  $mail->clearRecipients();
  $mail->clearCC();
  $mail->clearBCC();
  $mail->clearAttachments();
} else {
  echo "Login failed <br>";
}

?>
